﻿using System;
using System.Data;

namespace ZHONGLANGWEBUI
{
    public partial class Login : System.Web.UI.Page
    { 
        protected void Page_Load(object sender, System.EventArgs e) { if (!IsPostBack) {
                Session.Clear(); txtUserName.Focus(); 
                this.Title = hidPowerName.Value;
                divZDKF.Text = hidAimCust.Value;
                divXTMC.InnerHtml = hidSysName.Value;
                divHYC.InnerHtml = hidWecome.Value;
                divJSZC.InnerHtml = hidTech.Value;
                divSYXZ.Visible = hidShowNote.Value == "1"; 

                string strTest = System.Configuration.ConfigurationManager.AppSettings["ZHONGLANG_TEST"].ToString();
                if (strTest == "1") { proLogin("wsb", "111111"); }

            } }
        protected void lbtnLogin_Click(object sender, EventArgs e) { proLogin(txtUserName.Text, txtPassword.Text);  }
        protected void proLogin(string strUserName,string strPassword)
        {
            TT_BasePage TT = new TT_BasePage();
            string strBack = TT.getUserLogin(strUserName, strPassword);
            if (strBack != "")
            {
                txtUserName.Focus();
                lblERR.Text = strBack;
                TT.jsMessage(strBack);
            }
            else
            {
                Response.Redirect("Index.ASPX");
            }
        }
    }
}